<%@ page import="edu.sctu.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018-5-10
  Time: 17:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>

    <style type="text/css">
        table{
            border-collapse: collapse;
        }

        td{

            border: 1px solid #000;
            padding: 10px;
        }
    </style>
</head>
<body>

<%
    List<User> userList = new ArrayList<>();

    User chen = new User();
    chen.setId(10010);
    chen.setName("chen");
    chen.setPassword("123456");

    userList.add(chen);

    pageContext.setAttribute("userList", userList);
%>

<table>
    <tr>
        <td>编号</td>
        <td>用户名</td>
        <td>密码</td>
    </tr>

    <c:forEach var="user" items="${userList}">
        <tr><td>${user.id}</td><td>${user.username}</td><td>${user.password}</td></tr>
    </c:forEach>

</table>
</body>
</html>
